﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Transactions;
using T.FAS.Runtime.Base.Entity;
using T.FAS.Runtime.Base.Service;

namespace T.FAS.Runtime.DataAccess.Engine.ValidateChecker
{
    internal class FASValidateRuleRTPClientProxy
    {
        private static readonly FASValidateRuleRTPClientProxy _instance = new FASValidateRuleRTPClientProxy();

        public static FASValidateRuleRTPClientProxy GetInstance()
        {
            return _instance;
        }

        private FASValidateRuleRTPClient _rtpClient = FASValidateRuleRTPClient.GetInstance();
        public List<ValidateRule> GetRules(Dictionary<string, object> extParams = null)
        {
            return _rtpClient.GetRules(extParams);
        }

        public ValidateRule GetRule(string ruleID)
        {
            return _rtpClient.GetRule(ruleID);
        }

        /// <summary>
        /// 更新规则的自定义属性
        /// </summary>
        /// <param name="rule"></param>
        public void UpdateCustomRuleContent(ValidateRule rule)
        {
            _rtpClient.UpdateCustomRuleContent(rule);
        }

        /// <summary>
        /// 更新规则的自定义属性
        /// </summary>
        /// <param name="rule"></param>
        public void UpdateCustomRuleContent(List<ValidateRule> rules)
        {
            _rtpClient.UpdateCustomRuleContent(rules);
        }
    }
}
